define(["knockout","durandal/app","app-main/modules/Breadcrumb/index"],
function (ko,app,Breadcrumb) {
	//var navbar = new Breadcrumbs('test');
	var navbar = new Breadcrumb({
		name:'test',
		header:{
			name:'测试列表'
		}
	});
	var index = ko.observable();
	var i = 1;
	var name = 'test';
	app.on('navbar.refresh.'+name).then(function (data) {
		console.log('refresh',ko.toJSON(data,null,2));
	})
	app.on('navbar.goto.'+name).then(function (data) {
		console.log('goto',ko.toJSON(data,null,2));
	})
	app.on('navbar.back.'+name).then(function (data) {
		console.log('back',ko.toJSON(data,null,2));
	})
	app.on('navbar.add.'+name).then(function (data) {
		console.log('add',ko.toJSON(data,null,2));
	})
	var navbarWithHeader=new Breadcrumb({
		name:'navbarWithHeader',
		header:{
			name:'list'
		}
	})
	return {
		navbar:navbar,
		navbarWithHeader:navbarWithHeader,
		index:index,
		goto:function(){
			navbar.goto(index());
		},
		add:function(){
			navbar.add({name:'item'+(i++)});
		},
		back:function(){
			navbar.back();
		},
		refresh:function(){
			navbar.refresh();
		},
		activate:function () {
			
		},
		binding:function () {
			
		},
		bindingComplete:function () {
			
		},
		attached:function () {
			
		},
		compositionComplete:function () {
			
		},
		detached:function () {
			
		}
	};
})